﻿@{
    ViewBag.Title = "MemberManage";
    Layout = "~/Views/Shared/_BootstrapUI.cshtml";
}
<link href="~/Content/dataTable/dtConfig.css" rel="stylesheet" />
<link href="~/Content/datetimePicker/datetimePicker.css" rel="stylesheet" />
<script src="~/Content/datetimePicker/moment.js"></script>
<script src="~/Scripts/ajaxfileupload.js"></script>

<div class="panel panel-default mb0">
    <div class="panel-body bb panel_inquire">
        <form id="form_inquire" role="form" class="form-inline">
            @*<div class="form-group">
                    <div id="datetimepicker_st" class="input-group date">
                        <input id="date_st" type="text" class="form-control" placeholder="录入开始日期" style="width: 110px;">
                        <span class="input-group-addon">
                            <span class="fa fa-calendar"></span>
                        </span>
                    </div>
                </div>
                <div class="form-group">
                    <div id="datetimepicker_ed" class="input-group date">
                        <input id="date_ed" type="text" class="form-control" placeholder="录入结束日期" style="width: 110px;">
                        <span class="input-group-addon">
                            <span class="fa fa-calendar"></span>
                        </span>
                    </div>
                </div>*@
            <div class="form-group">
                <input id="query" type="text" class="form-control" placeholder="关键字" style="width: 110px;">
            </div>
            <div class="form-group">
                <select id="levles" type="text" placeholder="会员级别" class="form-control  input-sm input-sm" required="required" data-parsley-error-message="请输入会员级别...">
                    @{
                        var blls = new FZKJ.BLL.buss_membergrade();
                        var lists = blls.GetModelList(" (isdel is null or isdel=0)");
                        <option value=""></option>
                        foreach (var item in lists)
                        {
                            <option value="@item.id">@item.name</option>
                        }
                    }
                </select>
            </div>
            <button id="btnInquire" type="button" class="btn btn-primary">查&nbsp;询</button>
        </form>
    </div>
    <input type="hidden" id="btn_val" />
    <div id="btnOp" class="panel-heading">
    </div>
    <div class="panel-body bt panel-body-dt-normal">
        <div class="table-responsive">
            <table id="dt_admin" class="table table-striped nowrap"></table>
        </div>
    </div>
</div>

<div id="InsuranceAccountAddModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabelLarge" aria-hidden="true" class="modal fade">
    <div class="modal-dialog" style="width: 80%">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" data-dismiss="modal" aria-label="Close" class="close">
                    <span aria-hidden="true">&times;</span>
                </button>
                <h4 id="title" class="modal-title">会员信息录入</h4>
            </div>
            <div class="modal-body">
                <form id="form" role="form" class="form-horizontal" data-parsley-validate="" novalidate="">
                    <div class="row">
                        <div class="col-md-4">
                            <div class="form-group">
                                <label class="col-md-4 control-label">姓名</label>
                                <div class="col-md-8">
                                    <input id="id" type="hidden" value="-1" />
                                    <input id="code" type="hidden" value="-1" />
                                    <input id="name" type="text" placeholder="姓名" class="form-control  input-sm input-sm" required="required" data-parsley-error-message="请输入姓名..." />
                                </div>
                            </div>
                        </div>
                        <div class="col-md-4">
                            <div class="form-group">
                                <label class="col-md-4 control-label">性别</label>
                                <div class="col-md-8">
                                    <select id="sex" type="text" placeholder="性别" class="form-control  input-sm input-sm" required="required" data-parsley-error-message="请输入性别...">
                                        <option value="0">男</option>
                                        <option value="1">女</option>
                                    </select>
                                </div>
                            </div>
                        </div>
                        <div class="col-md-4">
                            <div class="form-group">
                                <label class="col-md-4 control-label">身份证号码</label>
                                <div class="col-md-8">
                                    <input id="cardno" type="text" onkeyup="value=value.replace(/^[a-zA-Z]+\D*|^\d{0,16}[a-zA-Z]+|[^0-9Xx]/g,'') " onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))" maxlength="18" value="" placeholder="身份证号码" class="form-control  input-sm input-sm" required="required" data-parsley-error-message="请输入身份证号码..." />
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-4">
                            <div class="form-group">
                                <label class="col-md-4 control-label">手机号码</label>
                                <div class="col-md-8">
                                    <input id="mobile" type="text" placeholder="手机号码" class="form-control  input-sm input-sm" required="required" data-parsley-error-message="请输入手机号码..." />
                                </div>
                            </div>
                        </div>
                        <div class="col-md-4">
                            <div class="form-group">
                                <label class="col-md-4 control-label">紧急联系人</label>
                                <div class="col-md-8">
                                    <input id="emergencycontact" type="text" placeholder="紧急联系人" class="form-control  input-sm input-sm" required="required" data-parsley-error-message="请输入紧急联系人..." />
                                </div>
                            </div>
                        </div>
                        <div class="col-md-4">
                            <div class="form-group">
                                <label class="col-md-4 control-label">身份证照片</label>
                                <div class="col-md-8">
                                    <input type="file" id="coverpicture" name="coverpicture" placeholder="请输入关键字" class="form-control  input-sm  input-sm" required="required" onchange="UploadCard()" data-parsley-error-message="选择封面图片..." />
                                    <input id="cardpic" hidden="hidden" />
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-4">
                            <div class="form-group">
                                <label class="col-md-4 control-label">与紧急联系人关系</label>
                                <div class="col-md-8">
                                    <select id="emergencycontactrelation" type="text" placeholder="与紧急联系人关系" class="form-control  input-sm input-sm" required="required" data-parsley-error-message="请输入与紧急联系人关系...">
                                        <option value="夫妻">夫妻</option>
                                        <option value="父母">父母</option>
                                        <option value="子女">子女</option>
                                        <option value="朋友">朋友</option>
                                    </select>
                                </div>
                            </div>
                        </div>
                        <div class="col-md-4">
                            <div class="form-group">
                                <label class="col-md-4 control-label">紧急联系人手机号</label>
                                <div class="col-md-8">
                                    <input id="emergencycontactmobile" type="text" placeholder="紧急联系人手机号" class="form-control  input-sm input-sm" required="required" data-parsley-error-message="请输入紧急联系人手机号..." />
                                </div>
                            </div>
                        </div>
                        <div class="col-md-4">
                            <div class="form-group">
                                <label class="col-md-4 control-label">血型</label>
                                <div class="col-md-8">
                                    <select id="bloodType" type="text" placeholder="血型" class="form-control  input-sm input-sm" required="required" data-parsley-error-message="请输入血型...">
                                        @{
                                            var boolType = new FZKJ.BLL.sys_dict().GetModelList(" value='bloodType'");
                                            if (boolType.Count > 0)
                                            {
                                                var lists1 = new FZKJ.BLL.sys_dict().GetModelList(" pid='" + boolType[0].id + "'");
                                                foreach (var item in lists1)
                                                {
                                                    <option value="@item.label">@item.label</option>
                                                }
                                            }
                                        }
                                    </select>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-4">
                            <div class="form-group">
                                <label class="col-md-4 control-label">病史</label>
                                <div class="col-md-8">
                                    <input id="illnesshistory" type="text" placeholder="病史" class="form-control  input-sm input-sm" required="required" data-parsley-error-message="请输入病史..." />
                                </div>
                            </div>
                        </div>
                        <div class="col-md-4">
                            <div class="form-group">
                                <label class="col-md-4 control-label">现居地址</label>
                                <div class="col-md-8">
                                    <input id="presentaddress" type="text" placeholder="现居地址" class="form-control  input-sm input-sm" required="required" data-parsley-error-message="请输入现居地址..." />
                                </div>
                            </div>
                        </div>
                        <div class="col-md-4">
                            <div class="form-group">
                                <label class="col-md-4 control-label">积分</label>
                                <div class="col-md-8">
                                    <input id="point" type="text" placeholder="积分" onkeyup="if(this.value.length==1){this.value=this.value.replace(/[^1-9]/g,'')}else{this.value=this.value.replace(/\D/g,'')}" onafterpaste="if(this.value.length==1){this.value=this.value.replace(/[^1-9]/g,'')}else{this.value=this.value.replace(/\D/g,'')}" class="form-control  input-sm input-sm" required="required" data-parsley-error-message="请输入积分..." />
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-4">
                            <div class="form-group">
                                <label class="col-md-4 control-label">会员等级</label>
                                <div class="col-md-8">
                                    <select id="grade" type="text" placeholder="病史" class="form-control  input-sm input-sm" required="required" data-parsley-error-message="请输入病史...">
                                        @{
                                            var bll = new FZKJ.BLL.buss_membergrade();
                                            var list = bll.GetModelList(" (isdel is null or isdel=0)");
                                            foreach (var item in list)
                                            {
                                                <option value="@item.id">@item.name</option>
                                            }
                                        }
                                    </select>
                                </div>
                            </div>
                        </div>
                        <div class="col-md-4">
                            <div class="form-group">
                                <label class="col-md-4 control-label">收货地址</label>
                                <div class="col-md-8">
                                    <input id="receiveaddress" type="text" placeholder="收货地址" class="form-control  input-sm input-sm" required="required" data-parsley-error-message="请输入收货地址..." />
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row" id="personCar" style="text-align:center;display:none">
                        <img id="carImg" src="" style="width:200px" />
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" data-dismiss="modal" class="btn btn-default">关闭</button>
                <button id="btnMembersSave" type="button" class="btn btn-primary">保存</button>
            </div>
        </div>
    </div>
</div>

<div id="PolicyAddModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabelLarge" aria-hidden="true" class="modal fade">
    <div class="modal-dialog" style="width: 50%">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" data-dismiss="modal" aria-label="Close" class="close">
                    <span aria-hidden="true">&times;</span>
                </button>
                <h4 id="policytitle" class="modal-title">保单信息录入</h4>
            </div>
            <div class="modal-body">
                <form id="form" role="form" class="form-horizontal" data-parsley-validate="" novalidate="">
                    <div class="row">
                        <div class="col-md-12">
                            <div class="form-group">
                                <label class="col-md-4 control-label">保单号</label>
                                <div class="col-md-8">
                                    <input id="memberid" type="hidden" value="-1" />
                                    <input id="policynumber" type="text" placeholder="保单号" class="form-control  input-sm input-sm" required="required" data-parsley-error-message="请输入保单号..." />
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-12">
                            <div class="form-group">
                                <label class="col-md-4 control-label">保单图片</label>
                                <div class="col-md-8">
                                    <input id="policypicture" hidden="hidden" />
                                    <input type="file" id="policypic" name="policypic" placeholder="请输入关键字" class="form-control  input-sm  input-sm" required="required" onchange="UploadPloicy()" data-parsley-error-message="选择保单图片..." />
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="row">
                        <div class="col-md-12">
                            <div class="form-group">
                                <label class="col-md-4 control-label">保险公司</label>
                                <div class="col-md-8">
                                    <select id="company" name="company" type="text" class="form-control  input-sm input-sm" required="required">
                                        @{
                                            var blls1 = new FZKJ.BLL.sys_dict();
                                            var lists13 = blls1.GetModelList(" value='insurancecompany'");
                                            if (lists13.Count > 0)
                                            {
                                                var lists12 = blls1.GetModelList(" pid='" + lists13[0].id + "'");
                                                foreach (var item in lists12)
                                                {
                                                    <option value="@item.id">@item.label</option>
                                                }
                                            }
                                        }
                                    </select>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-12">
                            <div class="form-group">
                                <label class="col-md-4 control-label">保险代理公司</label>
                                <div class="col-md-8">
                                    <input id="insureanceAgent" type="text" placeholder="保险代理公司" class="form-control  input-sm input-sm" required="required" data-parsley-error-message="请输入保险代理公司..." />
                                </div>
                            </div>
                        </div>
                    </div>

                </form>
            </div>
            <div class="modal-footer">
                <button type="button" data-dismiss="modal" class="btn btn-default">关闭</button>
                <button id="btnMembersPolicySave" type="button" class="btn btn-primary">保存</button>
            </div>
        </div>
    </div>
</div>

<div id="RescueAddModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabelLarge" aria-hidden="true" class="modal fade">
    <div class="modal-dialog" style="width: 80%">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" data-dismiss="modal" aria-label="Close" class="close">
                    <span aria-hidden="true">&times;</span>
                </button>
                <h4 id="restitle" class="modal-title">救援卡信息录入</h4>
            </div>
            <div class="modal-body">
                <form id="form" role="form" class="form-horizontal" data-parsley-validate="" novalidate="">
                    <div class="row">
                        <div class="col-md-4">
                            <div class="form-group">
                                <label class="col-md-4 control-label">救援卡卡号</label>
                                <div class="col-md-8">
                                    <input id="rmemberid" type="hidden" value="-1" />
                                    <input id="rescuecard" type="text" placeholder="救援卡卡号" class="form-control  input-sm input-sm" required="required" data-parsley-error-message="请输入救援卡卡号..." />
                                </div>
                            </div>
                        </div>
                        <div class="col-md-4">
                            <div class="form-group">
                                <label class="col-md-4 control-label">救援卡起始日期</label>
                                <div class="col-md-8">
                                    <div class="form-group" style="margin-left: 0px; margin-right: 0px;">
                                        <div id="datetimepicker_start" class="input-group date">
                                            <input id="rescuestart" type="text" class="form-control  input-sm" placeholder="救援卡起始日期">
                                            <span class="input-group-addon">
                                                <span class="fa fa-calendar"></span>
                                            </span>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="col-md-4">
                            <div class="form-group">
                                <label class="col-md-4 control-label">救援生效止期</label>
                                <div class="col-md-8">
                                    <div class="form-group" style="margin-left: 0px; margin-right: 0px;">
                                        <div id="datetimepicker_end" class="input-group date">
                                            <input id="rescueend" type="text" class="form-control  input-sm" placeholder="救援生效止期">
                                            <span class="input-group-addon">
                                                <span class="fa fa-calendar"></span>
                                            </span>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-4">
                            <div class="form-group">
                                <label class="col-md-4 control-label">服务区</label>
                                <div class="col-md-8">
                                    <input id="servicearea" type="text" placeholder="服务区" class="form-control  input-sm input-sm" required="required" data-parsley-error-message="请输入服务区..." />
                                </div>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" data-dismiss="modal" class="btn btn-default">关闭</button>
                <button id="btnMembersResSave" type="button" class="btn btn-primary">保存</button>
            </div>
        </div>
    </div>
</div>

<script src="~/Content/datetimePicker/moment.js"></script>
<script src="~/Content/datetimePicker/datetimePicker.js"></script>
<script src="~/Pscripts/User/MemberManage.js?v=@DateTime.Now.ToString("yyyyMMddHHmmssfff")"></script>
